{$MODE objfpc}

unit PythonDescrObject;

interface
	uses PythonObject, PythonMethodObject, PythonStructMember;

// Flags for wrapperbase
const PyWrapperFlag_KEYWORDS = 1; // wrapper function takes keyword args

var
	PyWrapperDescr_Type: PyTypeObject; cvar; external;
	PyProperty_Type: PyTypeObject; cvar; external;

		
function PyDescr_NewMethod(typ: PyTypeObjectPtr; obj: PyMethodDefPtr): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyDescr_NewMethod}
	
function PyDescr_NewClassMethod(typ: PyTypeObjectPtr; meth: PyMethodDefPtr): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyDescr_NewClassMethod}
	
function PyDescr_NewMember(typ: PyTypeObjectPtr; meth: PyMemberDefPtr): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyDescr_NewMember}
	
function PyDescr_NewGetSet(typ: PyTypeObjectPtr; def: PyGetSetDefPtr): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyDescr_NewGetSet}
	
function PyDescr_NewWrapper(typ: PyTypeObjectPtr; wrap: wrapperbasePtr; p: Pointer): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyDescr_NewWrapper}

function PyDictProxy_New(obj: PyObjectPtr): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyDictProxy_New}
	
function PyWrapper_New(obj, obj1: PyObjectPtr): PyObjectPtr; cdecl; external;
	{$EXTERNALSYM PyWrapper_New}

//
// Things implemented here...
//
function PyDescr_IsData(d: PyObjectPtr): Boolean;

implementation

function PyDescr_IsData(d: PyObjectPtr): Boolean;
begin
	result := d.ob_type.tp_descr_set <> nil;
end;

end.
